﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
namespace Things.Web.Crops
{
    public partial class Show : Page
    {
        public string strid = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
                {
                    strid = Request.Params["id"];
                    Guid CropsID = new Guid(strid);
                    ShowInfo(CropsID);
                }
            }
        }

        private void ShowInfo(Guid CropsID)
        {
            Things.BLL.Crops bll = new Things.BLL.Crops();
            Things.Model.Crops model = bll.GetModel(CropsID);
            this.lblCropsName.Text = model.CropsName;
            this.lblCropsKind.Text = model.CropsKind;
            this.lblCropsID.Text = model.CropsID.ToString();
            this.lblFarmID.Text = model.FarmAddress;
            this.lblPlanDate.Text = model.PlanDate.ToString();
            this.lblIsProducted.Text = model.IsProducted ? "是" : "否";

        }

        protected void btnGoList_Click(object sender, EventArgs e)
        {
            Response.Redirect("list.aspx");
        }


    }
}
